import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.lang.annotation.RetentionPolicy;

public class TestAnno {
    // use annotation
    @MyAnnotation(name="halo",schools = {"南华","北华"})
    public void tset(){}
    @MyAnnotation(id=2,name="halo")
    public void tset2(){}
    @MyAnnotation2("halo")
    public void tset3(){}
}
@Target({ElementType.TYPE,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation{
    // 定义注解的参数
    String name() default "";
    int age() default 0;
    int id() default -1;
    String[] schools() default {"南华","北华"};
}
@Target({ElementType.TYPE,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation2{
    String value();
}